package com.hejielife.activeobject1;

/**
 * 2019年8月2日 下午5:15:47
 * 
 * @author hejielife
 * @despribe FutureResult
 */
class FutureResult extends Result {
	private Result result;
	private boolean ready = false;

	public synchronized void setResult(Result result) {
		this.result = result;
		this.ready = true;
		notifyAll();
	}

	public synchronized Object getResultValue() {
		while (!ready) {
			try {
				wait();
			} catch (InterruptedException e) {
			}
		}
		return result.getResultValue();
	}
}
